package a.f.l.a;

import a.c.d;
import a.d.t;
import a.f.tb;

class qc
{
  private static final double a = 1.0E-006D;
  private m b;
  private static final Object c = "LEFT_SIDE";
  private static final Object d = "RIGHT_SIDE";
  private static final Object f = "BOTH_SIDES";
  private boolean g;
  private Object[] h = new Object[4];
  private eb[] i = new eb[4];
  boolean j;
  private eb[] k = new eb[4];
  boolean m;
  
  public qc(m paramm)
  {
    this.b = paramm;
    tb localtb1 = paramm.o();
    tb localtb2 = paramm.p();
    if (!bool)
    {
      if (localtb1 != null)
      {
        if (bool) {
          break label78;
        }
        if (localtb2 != null) {}
      }
      else
      {
        this.g = true;
      }
    }
    else {
      return;
    }
    label78:
    eb localeb1 = localtb1.f();
    eb localeb2 = localtb2.c().f();
    label256:
    label257:
    Object localObject2;
    if (!bool) {
      if (localeb1 == localeb2)
      {
        localeb3 = this.b.m().e();
        eb localeb4 = this.b.n().e();
        if (!bool)
        {
          if (localeb3.a(localeb4, Math.min(1.0E-006D, Math.min(localeb3.d(), localeb4.d())))) {
            this.g = true;
          }
        }
        else if (i2 == 0) {
          return;
        }
        localObject1 = (bool) || ((localtb1 == tb.b) || (localtb1 == tb.a)) ? 1 : 0;
        if (!bool) {
          if (localObject1 != 0)
          {
            if (bool) {
              break label257;
            }
            if (localeb3.a() < localeb4.a()) {
              break label256;
            }
          }
        }
        if ((bool) || (localObject1 == 0)) {
          if (bool) {}
        }
        int n = localeb3.b() > localeb4.b() ? 1 : 0;
        localObject2 = n != 0 ? c : d;
        int i1 = 0;
        label403:
        do
        {
          if (i1 >= 4) {
            break;
          }
          if (!bool)
          {
            if (localeb1 != i1) {
              this.h[i1] = localObject2;
            }
          }
          else
          {
            if (bool) {
              continue;
            }
            if (i2 == 0) {
              break label403;
            }
          }
          eb localeb7 = eb.c(localeb3, localeb4);
          eb localeb8 = eb.b(localeb3, localeb4);
          if (!bool)
          {
            if (n != 0)
            {
              this.j = true;
              this.i[i1] = localeb7;
              this.k[i1] = localeb8;
              if (bool) {
                continue;
              }
              if (i2 == 0) {}
            }
            else
            {
              this.m = true;
              this.k[i1] = localeb7;
            }
          }
          else {
            this.i[i1] = localeb8;
          }
          i1++;
        } while (i2 == 0);
      }
    }
    eb localeb3 = (bool) || (localeb2 < localeb1) ? localeb2 + 4 : localeb2;
    eb localeb5 = localeb1 + 1;
    do
    {
      do
      {
        if (localeb5 >= localeb3) {
          break;
        }
        this.h[(localeb5 % 4)] = c;
        localeb5++;
        if ((!bool) && (i2 != 0)) {
          break label501;
        }
      } while (i2 == 0);
    } while (bool);
    label501:
    localeb5 = (bool) || (localeb1 < localeb2) ? localeb1 + 4 : localeb1;
    Object localObject1 = localeb2 + 1;
    do
    {
      if (localObject1 >= localeb5) {
        break;
      }
      this.h[(localObject1 % 4)] = d;
      localObject1++;
      if ((!bool) && (i2 != 0)) {
        return;
      }
    } while (i2 == 0);
    localObject1 = this.b.l().h();
    if (!bool)
    {
      eb localeb6;
      switch (localeb1)
      {
      case 0: 
        localeb6 = new eb(((t)localObject1).d(), this.b.m().c());
        localObject2 = new eb(this.b.m().b(), ((t)localObject1).d() + ((t)localObject1).b());
        if (bool) {
          break label878;
        }
        if (i2 == 0) {
          break;
        }
      case 1: 
        localeb6 = new eb(((t)localObject1).e(), this.b.m().c());
        localObject2 = new eb(this.b.m().b(), ((t)localObject1).e() + ((t)localObject1).c());
        if (bool) {
          break label878;
        }
        if (i2 == 0) {
          break;
        }
      case 2: 
        localeb6 = new eb(this.b.m().b(), ((t)localObject1).d() + ((t)localObject1).b());
        localObject2 = new eb(((t)localObject1).d(), this.b.m().c());
        if (bool) {
          break label878;
        }
        if (i2 == 0) {
          break;
        }
      case 3: 
        localeb6 = new eb(this.b.m().b(), ((t)localObject1).e() + ((t)localObject1).c());
        localObject2 = new eb(((t)localObject1).e(), this.b.m().c());
        if (bool) {
          break label878;
        }
        if (i2 == 0) {
          break;
        }
      default: 
        localeb6 = null;
        localObject2 = null;
      }
      this.i[localeb1] = localeb6;
      this.k[localeb1] = localObject2;
      label878:
      if (!bool) {}
      switch (localeb2)
      {
      case 0: 
        localObject2 = new eb(((t)localObject1).d(), this.b.n().c());
        localeb6 = new eb(this.b.n().b(), ((t)localObject1).d() + ((t)localObject1).b());
        if (bool) {
          break label1183;
        }
        if (i2 == 0) {
          break;
        }
      case 1: 
        localObject2 = new eb(((t)localObject1).e(), this.b.n().c());
        localeb6 = new eb(this.b.n().b(), ((t)localObject1).e() + ((t)localObject1).c());
        if (bool) {
          break label1183;
        }
        if (i2 == 0) {
          break;
        }
      case 2: 
        localObject2 = new eb(this.b.n().b(), ((t)localObject1).d() + ((t)localObject1).b());
        localeb6 = new eb(((t)localObject1).d(), this.b.n().c());
        if (bool) {
          break label1183;
        }
        if (i2 == 0) {
          break;
        }
      case 3: 
        localObject2 = new eb(this.b.n().b(), ((t)localObject1).e() + ((t)localObject1).c());
        localeb6 = new eb(((t)localObject1).e(), this.b.n().c());
        if (bool) {
          break label1183;
        }
        if (i2 == 0) {
          break;
        }
      default: 
        localeb6 = null;
        localObject2 = null;
      }
      this.i[localeb2] = localeb6;
      label1183:
      this.k[localeb2] = localObject2;
    }
  }
  
  private int a(tb paramtb, boolean paramBoolean)
  {
    if (!sb.e) {
      if (paramBoolean) {
        return paramtb.f();
      }
    }
    return (paramtb.f() + 2) % 4;
  }
  
  public b_ a(m paramm, a_ parama_)
  {
    boolean bool5 = sb.e;
    int i5 = sb.d;
    if ((this.g) || (paramm.o() == null)) {
      return new b_(0);
    }
    eb localeb1 = null;
    int n = a(paramm.o(), true);
    if ((bool5) || (this.h[n] != null))
    {
      localObject1 = this.h[n];
      if (!bool5) {
        if (i5 == 0) {
          break label299;
        }
      }
    }
    else
    {
      if (bool5) {
        break label112;
      }
    }
    if (paramm.e() != 0)
    {
      if (bool5) {
        break label128;
      }
      localeb2 = paramm.m().e();
      if (i5 == 0) {
        break label132;
      }
    }
    label112:
    eb localeb2 = localeb1 = eb.a(paramm.m().e(), paramm.n().e());
    label128:
    label132:
    if (!bool5) {}
    double d1 = localeb2.d() > 1.0E-006D ? 1.0E-006D : 0.0D;
    boolean bool1 = this.i[n].a(localeb2, d1);
    if (!bool5) {}
    bool1 = (bool5) || (this.j) ? false : !bool1 ? true : bool1;
    boolean bool2 = this.k[n].a(localeb2, d1);
    if (!bool5) {}
    bool2 = (bool5) || (this.m) ? false : !bool2 ? true : bool2;
    if (!bool5) {}
    Object localObject1 = bool2 ? d : bool1 ? c : bool2 ? f : null;
    label299:
    int i1 = a(paramm.p(), false);
    Object localObject2;
    if ((bool5) || (this.h[i1] != null))
    {
      localObject2 = this.h[i1];
      if ((!bool5) && (i5 == 0)) {}
    }
    else
    {
      if ((bool5) || (paramm.e() != 0))
      {
        localObject3 = paramm.n().e();
        if (bool5) {
          break label421;
        }
        if (i5 == 0) {}
      }
      else
      {
        if (!bool5) {}
        localObject3 = localeb1 != null ? localeb1 : eb.a(paramm.m().e(), paramm.n().e());
      }
      if (!bool5) {}
      label421:
      double d2 = ((eb)localObject3).d() > 1.0E-006D ? 1.0E-006D : 0.0D;
      boolean bool3 = this.i[i1].a((eb)localObject3, d2);
      if (!bool5) {}
      bool3 = (bool5) || (this.j) ? false : !bool3 ? true : bool3;
      boolean bool4 = this.k[i1].a((eb)localObject3, d2);
      if (!bool5) {}
      bool4 = (bool5) || (this.m) ? false : !bool4 ? true : bool4;
      if (!bool5) {}
      localObject2 = bool4 ? d : bool3 ? c : bool4 ? f : null;
    }
    if ((bool5) || (localObject1 != null))
    {
      if (bool5) {
        break label605;
      }
      if (localObject2 != null) {}
    }
    else
    {
      return new b_(0);
    }
    label605:
    if (!bool5) {
      if (localObject1 == f)
      {
        if (bool5) {
          break label644;
        }
        if (localObject2 == f) {
          return new b_(0, parama_);
        }
      }
    }
    label644:
    if (!bool5)
    {
      if (localObject1 != f)
      {
        if (bool5) {
          break label735;
        }
        if (localObject2 != f) {
          break label731;
        }
      }
      if (bool5) {
        break label680;
      }
    }
    label680:
    Object localObject3 = localObject1 != f ? localObject1 : localObject2;
    a_ locala_ = new a_(paramm.k(), this.b.k(), localObject3, 1);
    b_ localb_ = new b_(0, locala_);
    localb_.a(parama_);
    return localb_;
    label731:
    if (localObject1 == localObject2)
    {
      label735:
      if ((bool5) || (parama_ != null)) {
        if (bool5) {}
      }
      i2 = !parama_.f.equals(localObject1) ? parama_.d() : 0;
      if (((!bool5) && ((this.b.e() == 2) && (bool5))) || ((paramm.e() == 2) && ((bool5) || ((this.h[n] != null) && (this.h[i1] != null)))))
      {
        if (!bool5) {
          if (paramm.o().d())
          {
            d3 = paramm.n().e().c(paramm.m().f());
            d4 = paramm.m().e().c(paramm.n().f());
            i4 = paramm.o().c().f();
            i3 = paramm.p().f();
            if (bool5) {
              break label969;
            }
            if (i5 == 0) {
              break label971;
            }
          }
        }
        double d3 = paramm.m().e().c(paramm.n().f());
        double d4 = paramm.n().e().c(paramm.m().f());
        int i3 = paramm.o().c().f();
        int i4 = paramm.p().f();
        if (((!bool5) && ((localObject1 == c) && ((!bool5) && ((!this.i[i4].a(d4)) && ((!bool5) && (!this.i[i3].a(d3))))))) || ((localObject1 == d) && ((bool5) || ((!this.k[i4].a(d4)) && (!this.k[i3].a(d3)))))) {
          i2 += 2;
        }
      }
      return new b_(i2);
    }
    label969:
    label971:
    if ((bool5) || (parama_ != null)) {
      if (bool5) {}
    }
    int i2 = !parama_.f.equals(localObject1) ? parama_.d() : 0;
    return new b_(1 + i2);
  }
  
  static class b_
  {
    private int a;
    private qc.a_ b;
    
    public b_(int paramInt)
    {
      this(paramInt, null);
    }
    
    public b_(int paramInt, qc.a_ parama_)
    {
      this.a = paramInt;
      this.b = parama_;
    }
    
    public int a()
    {
      return this.a;
    }
    
    public qc.a_ c()
    {
      return this.b;
    }
    
    public boolean d()
    {
      return this.b != null;
    }
    
    public void a(qc.a_ parama_)
    {
      boolean bool = sb.e;
      int m = sb.d;
      if (!bool) {
        if (this.b == null)
        {
          this.b = parama_;
          if (m == 0) {
            return;
          }
        }
      }
      if (((bool) || (parama_ != null)) && ((bool) || (this.b.a(parama_))))
      {
        int i = this.b.d();
        int j = parama_.d();
        int k = Math.min(i, j);
        this.a += k;
        if (!bool)
        {
          if (j > k)
          {
            this.b = new qc.a_(qc.a_.access$100(parama_), qc.a_.access$200(parama_), qc.a_.access$000(parama_), j - k);
            if ((!bool) && (m == 0)) {
              return;
            }
          }
          if (bool) {}
        }
        else
        {
          if (i <= k) {
            break label168;
          }
          if (bool) {
            break label169;
          }
          this.b.a(i - k);
        }
        if (m != 0) {
          label168:
          label169:
          this.b = null;
        }
      }
    }
  }
  
  static class a_
  {
    private int a;
    private final d c;
    private final d d;
    private Object f;
    
    a_(d paramd1, d paramd2, Object paramObject, int paramInt)
    {
      this.c = paramd1;
      this.d = paramd2;
      this.f = paramObject;
      this.a = paramInt;
    }
    
    public d a()
    {
      return this.d;
    }
    
    public d b()
    {
      return this.c;
    }
    
    public int d()
    {
      return this.a;
    }
    
    public void a(int paramInt)
    {
      this.a = paramInt;
    }
    
    public boolean a(a_ parama_)
    {
      if (!sb.e) {}
      return !this.f.equals(parama_.f);
    }
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.l.a.qc
 * JD-Core Version:    0.7.0.1
 */